package com.example.day08;

import java.io.*;

public class BufferStreamTest {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream("D:/ideaIC-2022.3.2.exe"));
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("D:/idea.exe"));
        int i;
        long start = System.currentTimeMillis();
        while ((i = bufferedInputStream.read()) != -1) {
            bufferedOutputStream.write(i);
        }
        System.out.println(System.currentTimeMillis() - start + "ms.");
        bufferedOutputStream.close();
        bufferedInputStream.close();

    }
}
